package com.ruoyi.waterManagement.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.business.waterManagement.WrStatvolH;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.datascope.annotation.DataScope;
import com.ruoyi.waterManagement.domain.vo.RzsWrStatvolHwrVO;
import com.ruoyi.waterManagement.mapper.WrStatvolHMapper;
import com.ruoyi.waterManagement.service.IWrStatvolHService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 测站时段水量Service业务层处理
 * 
 * @author hwd
 * @date 2023-02-21
 */
@Service
public class WrStatvolHServiceImpl implements IWrStatvolHService
{
    @Autowired
    private WrStatvolHMapper wrStatvolHMapper;

    /**
     * 查询测站时段水量
     * 
     * @param statCd 测站时段水量主键
     * @return 测站时段水量
     */
    @Override
    public WrStatvolH selectWrStatvolHByStatCd(String statCd)
    {
        return wrStatvolHMapper.selectWrStatvolHByStatCd(statCd);
    }

    /**
     * 查询测站时段水量列表
     * 
     * @param wrStatvolH 测站时段水量
     * @return 测站时段水量
     */
    @Override
    public List<WrStatvolH> selectWrStatvolHList(WrStatvolH wrStatvolH)
    {
        if (wrStatvolH.getStatHour()!=null){
            String [] strings= DateUtils.jsYmd(wrStatvolH.getStatHour());
            String yy =strings[0];
            String mm =strings[1];
            String dd =strings[2];
            wrStatvolH.setYy(yy);
            wrStatvolH.setMm(mm);
            wrStatvolH.setDd(dd);
        }
        return wrStatvolHMapper.selectWrStatvolHList(wrStatvolH);
    }

    /**
     * 新增测站时段水量
     * 
     * @param wrStatvolH 测站时段水量
     * @return 结果
     */
    @Override
    public int insertWrStatvolH(WrStatvolH wrStatvolH)
    {
        return wrStatvolHMapper.insertWrStatvolH(wrStatvolH);
    }

    /**
     * 修改测站时段水量
     * 
     * @param wrStatvolH 测站时段水量
     * @return 结果
     */
    @Override
    public int updateWrStatvolH(WrStatvolH wrStatvolH)
    {
        return wrStatvolHMapper.updateWrStatvolH(wrStatvolH);
    }

    /**
     * 批量删除测站时段水量
     * 
     * @param statCds 需要删除的测站时段水量主键
     * @return 结果
     */
    @Override
    public int deleteWrStatvolHByStatCds(String[] statCds)
    {
        return wrStatvolHMapper.deleteWrStatvolHByStatCds(statCds);
    }

    /**
     * 删除测站时段水量信息
     * 
     * @param statCd 测站时段水量主键
     * @return 结果
     */
    @Override
    public int deleteWrStatvolHByStatCd(String statCd)
    {
        return wrStatvolHMapper.deleteWrStatvolHByStatCd(statCd);
    }

    @Override
    public List<RzsWrStatvolHwrVO> selectRzsWrStatvolHwrVOList(RzsWrStatvolHwrVO rzsWrStatvolHwrVO) {
        return wrStatvolHMapper.selectRzsWrStatvolHwrVOList(rzsWrStatvolHwrVO);
    }

    @Override
    public List<RzsWrStatvolHwrVO> listOrgCd(RzsWrStatvolHwrVO rzsWrStatvolHwrVO) {
        return wrStatvolHMapper.listOrgCd(rzsWrStatvolHwrVO);
    }

}
